// copyright (c) 2025 author:fio66<fio66@foxmail.com>. All rights reserved.
// date: 2025-08-19 13:57:04

#ifndef _AUDIO_PLAYER_SRC_CEF_AUDIO_PLAYER_APP_H_
#define _AUDIO_PLAYER_SRC_CEF_AUDIO_PLAYER_APP_H_

#include <include/cef_app.h>

#include "src/event/event_handler.h"

namespace fio66 {
// Implement application-level callbacks for the browser process.
class AudioPlayerApp : public CefApp,
                       public CefBrowserProcessHandler,
                       public EventHandler {
 public:
  AudioPlayerApp(EventDispatcher* dispatcher);


  // CefApp methods:
  CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() override {
    return this;
  }

  // CefBrowserProcessHandler methods:
  void OnContextInitialized() override;
  CefRefPtr<CefClient> GetDefaultClient() override;

  // EventHandler methods:
  void OnEvent(EventType event_type, const std::any& data) override;


 private:
  // Include the default reference counting implementation.
  IMPLEMENT_REFCOUNTING(AudioPlayerApp);
};

}  // namespace fio66

#endif  // _AUDIO_PLAYER_SRC_CEF_AUDIO_PLAYER_APP_H_
